package com.asset.dispoal.file.clouddesk.service;

import com.asset.dispoal.file.clouddesk.api.CloudDeskService;
import com.asset.dispoal.file.clouddesk.dto.CloudDeskAddRequest;
import com.asset.dispoal.file.clouddesk.dto.CloudDeskDelRequest;
import com.asset.dispoal.file.clouddesk.dto.CloudDeskQueryRequest;
import com.asset.dispoal.file.clouddesk.dto.CloudDeskQueryResponse;
import com.asset.dispoal.file.clouddesk.service.command.CloudDeskCreateCommand;
import com.asset.dispoal.file.clouddesk.service.command.CloudDeskDeleteCommand;
import com.asset.dispoal.file.clouddesk.service.command.CloudDeskQueryCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.mhuang.pacebox.springboot.protocol.Result;

import java.util.List;

@Service
public class CloudDeskServiceImpl implements CloudDeskService {

    @Autowired
    CloudDeskQueryCommand queryCommand;

    @Autowired
    CloudDeskCreateCommand createCommand;

    @Autowired
    CloudDeskDeleteCommand deleteCommand;

    @Override
    public Result<List<CloudDeskQueryResponse>> query(CloudDeskQueryRequest request) {
        return queryCommand.execute(request);
    }

    @Override
    public Result create(CloudDeskAddRequest request) {
        return createCommand.execute(request);
    }

    @Override
    public Result delete(CloudDeskDelRequest request) {
        return deleteCommand.execute(request);
    }
}